package com.zwj.rms.controller;


import com.zwj.rms.bo.DeptBo;
import com.zwj.rms.entity.SysDeptEntity;
import com.zwj.rms.service.SysDeptService;
import com.zwj.rms.vo.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 部门表 前端控制器
 * </p>
 *
 * @author zwj
 * @since 2021-09-14
 */
@RestController
@RequestMapping("/dept")
public class SysDeptController {
    private final SysDeptService sysDeptService;

    public SysDeptController(SysDeptService sysDeptService) {
        this.sysDeptService = sysDeptService;
    }

    @ApiOperation(value = "条件查询部门", notes = "条件查询部门")
    @PostMapping("/selectDept")
    public Result selectDept(@RequestBody DeptBo deptBo) {
        return sysDeptService.selectDept(deptBo);
    }
    @ApiOperation(value = "修改角色状态", notes = "修改角色状态")
    @PostMapping("/updateDeptStatus")
    public Result updateDeptStatus(@RequestBody DeptBo deptBo) {
        return sysDeptService.updateDeptStatus(deptBo);
    }
    @ApiOperation(value = "删除角色", notes = "删除角色")
    @PostMapping("/deleteDept")
    public Result deleteDept(@RequestBody DeptBo deptBo) {
        return sysDeptService.deleteDept(deptBo);
    }
    @ApiOperation(value = "添加角色", notes = "添加角色")
    @PostMapping("/addDept")
    public Result addDept(@RequestBody SysDeptEntity sysDeptEntity) {
        return sysDeptService.addDept(sysDeptEntity);
    }
    @ApiOperation(value = "修改角色信息", notes = "修改角色信息")
    @PostMapping("/updateDept")
    public Result updateDept(@RequestBody SysDeptEntity sysDeptEntity) {
        return sysDeptService.updateDept(sysDeptEntity);
    }
}

